//
//  YZDisplayTitleLabel.m
//  基本框架
//
//  Created by runone02 on 2018/7/17.
//  Copyright © 2018年 liqiyun. All rights reserved.
//

#import "YZDisplayTitleLabel.h"

@implementation YZDisplayTitleLabel

- (void)drawRect:(CGRect)rect{
    [super drawRect:rect];
    [_fillColor set];
    rect.size.width = rect.size.width * _progress;
    
    UIRectFillUsingBlendMode(rect, kCGBlendModeSourceIn);
}

- (instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        self.backgroundColor = [UIColor clearColor];
        self.userInteractionEnabled = YES;
        self.textAlignment = NSTextAlignmentCenter;
    }
    return self;
}


- (void)setProgress:(CGFloat)progress{
    _progress = progress;
    [self setNeedsDisplay];
}
@end
